@echo off
chcp 65001 >nul
echo === 启动RocketMQ Docker环境 ===

REM 创建日志目录
if not exist logs\rmqnamesrv mkdir logs\rmqnamesrv
if not exist logs\rmqbroker mkdir logs\rmqbroker

REM 启动RocketMQ服务
echo 启动RocketMQ NameServer...
docker-compose up -d rmqnamesrv

REM 等待NameServer启动
echo 等待NameServer启动...
timeout /t 10 /nobreak >nul

echo 启动RocketMQ Broker...
docker-compose up -d rmqbroker

REM 等待Broker启动
echo 等待Broker启动...
timeout /t 15 /nobreak >nul

echo 启动RocketMQ Console...
docker-compose up -d rmqconsole

REM 检查服务状态
echo 检查服务状态...
docker-compose ps

echo.
echo === RocketMQ服务启动完成 ===
echo NameServer: localhost:9876
echo Broker: localhost:10911
echo Console: http://localhost:8081
echo.
echo 现在可以启动Spring Boot应用了！
echo 使用命令: mvn spring-boot:run
echo.
pause
